package main.java.FSMDE.models;

import java.util.UUID;

public class TransitionFunctional extends Transition {

	private String functionName;

	protected TransitionFunctional(UUID transitionId, String transitionName) {

		id = transitionId;
		name = transitionName;
		source = null;
		destination = null;
		type = TransitionType.Functional;
		functionName = "";
	}

	protected TransitionFunctional(String transitionName) {

		id = UUID.randomUUID();
		name = transitionName;
		source = null;
		destination = null;
		type = TransitionType.Functional;
		functionName = "";
	}

	@Override
	public String toString() {
		return "<" + this.type + "> " + this.name;
	}

	public String getFunctionName() {
		return this.functionName;
	}

	public void setFunctionName(String name) {
		this.functionName = name;
	}

	@Override
	public String getModelDescription() {
		if (this.functionName.length() != 0)
			return this.name + " [" + this.functionName + "()]";
		return this.name + " [ no function setted ]";
	}
}
